package cn.com.bluemoon.daps.api.model;

import cn.com.bluemoon.daps.api.model.factory.RemoteDataModelRecordServiceFallbackFactory;
import cn.com.bluemoon.daps.common.constant.ServiceNameConstants;
import cn.com.bluemoon.daps.common.domain.ResultBean;
import cn.com.bluemoon.daps.model.entity.DapDataModelFieldRenameRecord;
import cn.com.bluemoon.daps.model.entity.DapDataModelRecord;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;

@FeignClient(value = ServiceNameConstants.DapsApiModel.SERVICE, fallbackFactory = RemoteDataModelRecordServiceFallbackFactory.class)
@RequestMapping(ServiceNameConstants.DapsApiModel.BASE_URI + ServiceNameConstants.DapsApiModel.API_RENAME_RECORD)
@ApiIgnore
public interface RemoteDapModelFieldRenameRecordService {

    @GetMapping("/rename/record")
    @ApiOperation("查询字段重命名记录")
    ResultBean<List<DapDataModelFieldRenameRecord>> renameRecordList(@RequestParam(value = "tableId") String tableId,
                                                                            @RequestParam(value = "fieldId", required = false) String fieldId);

    @DeleteMapping("/delete/record")
    @ApiOperation("删除表改名记录")
    ResultBean<String> deleteRecord(@RequestParam(value = "tableId") String tableId, @RequestParam(value = "fieldId", required = false) String fieldId);

}
